using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Viettel.VOFFICE.DAO.Models.Mapping
{
    public class NotificationMap : EntityTypeConfiguration<Notification>
    {
        public NotificationMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Contents)
                .HasMaxLength(200);

            this.Property(t => t.Url)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("Notifications");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Contents).HasColumnName("Contents");
            this.Property(t => t.Url).HasColumnName("Url");
            this.Property(t => t.CreatedAt).HasColumnName("CreatedAt");
            this.Property(t => t.UpdatedAt).HasColumnName("UpdatedAt");
            this.Property(t => t.NotiType).HasColumnName("NotiType");
            this.Property(t => t.IsRead).HasColumnName("IsRead");
            this.Property(t => t.ForUserId).HasColumnName("ForUserId");
        }
    }
}
